package com.shengzai.hdfs.text;

import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.fs.FileSystem;
import org.apache.hadoop.fs.Path;

import java.io.IOException;

public class HdfsCopyCode {
    public static void main(String[] args) throws IOException {
        Configuration entries = new Configuration();
        entries.set("fs.defaultFS","hdfs://master:9000");
        FileSystem fileSystem = FileSystem.get(entries);
        fileSystem.copyFromLocalFile(new Path("hadoop_code/src/data/a.txt"),new Path("/cp.txt"));
        fileSystem.close();
    }
}
